import gtk
import gtk.glade

class Quiz_Application:
    def __init__(self):
        self.gladefile = "quizgui.glade"
        self.wTree = gtk.glade.XML(self.gladefile)
    
        dic = {             
               "on_Main_Window_destroy" : gtk.main_quit,
               "on_file_button_clicked" : self.process,
               
                }
        self.wTree.signal_autoconnect(dic)
        self.window = self.wTree.get_widget("Main_Window")
        self.showText = self.wTree.get_widget("textview1")
        self.window.show()  
      

    def process(self,widget,data=None):
        file_obj = open('qanda.txt','r')
        a = file_obj.read()
        o = a.rstrip()
        self.showText.set_text(str(o))
        file_obj.close()

if __name__ =="__main__":
    q = Quiz_Application()
    gtk.main()
    
            


